<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <style>
        img{
            width: 250px;
        }
        .item-pic{
            column-count: 4;
            column-gap: 18px; 
            column-fill: auto;
        }
        *{
            padding: 0px;
            margin: 0px;
        }
        body{
            background-color: cornflowerblue;
        }
        .container{
            width: 1200px;
            margin: 10px auto;
        }
        .box{
            width: 250px;
            background-color: white;
            margin-bottom: 20px;
            padding: 10px;
            box-shadow: 0 0 5px black;
            break-inside: avoid; /*防止断层*/
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="item-pic">
            

            
        </div>
    </div>
    <script>
        for(var i = 0;i<16;i++){
            var node = $(`<div class="box"><img src="./picture/picture${i}.jpg" alt="">
                <h3>标题${i}</h3>
                <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem sapiente adipisci culpa rem, accusantium ipsa harum corporis labore voluptatibus. Suscipit dolore nulla distinctio a odio alias id itaque accusantium ducimus.</p></div>`)
                node.appendTo(".item-pic")
        }
        
    </script>
</body>
</html>